<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateShopOrderActivityTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_order_activity', function (Blueprint $table) {

            $table->id();
            $table->unsignedTinyInteger("type")->comment("活动类型")->default(0);
            $table->string("name", 120)->comment("活动名称")->default("");
            $table->unsignedTinyInteger("expireType")->comment("活动报名时间有效期类型")->default(0);
            $table->unsignedBigInteger("startTime")->comment("报名开始时间")->default(0);
            $table->unsignedBigInteger("endTime")->comment("报名截止时间")->default(0);
            $table->string("intro", 255)->comment("活动简介/推送简介")->default("");
            $table->string("title", 120)->comment("活动标题")->default("");
            $table->text("detail")->comment("活动详情说明 富文本")->default("");
            $table->unsignedTinyInteger("shopType")->comment("选择活动门店类型")->default(0);
            $table->text("remark")->comment("活动备注")->default("");
            $table->unsignedTinyInteger("status")->default(0)->comment("活动状态");


            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');

            $table->unsignedTinyInteger('isDeleted')->default(0)->comment('是否删除 0 否 1是');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '门店订货活动';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_order_activity');
    }
}
